<template>
<div>
  App
  <p>{{$store.state.username}}</p>
</div>
</template>
<script>
import { useStore } from 'vuex'
export default {
  name: 'App',
  setup () {
    // 使用vuex仓库
    const store = useStore()
    console.log(store.state.username)
    // store.commit('updatename')
    store.dispatch('updateName')
  }
}
</script>
<style lang="less">

</style>
